package com.kb.erp.controller;

import com.kb.erp.common.ApiResponse;
import com.kb.erp.service.PcbaOrderService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 订单数据同步到设计协同
 *
 * @author makejava
 * @since 2023-11-24 09:37:01
 */
@RestController
@RequestMapping("pcbaOrder")
public class PcbaOrderController {
    /**
     * 服务对象
     */
    @Resource
    private PcbaOrderService pcbaOrderService;


    /**
     * erp 2 edm
     * @param date
     * @return
     */
    @GetMapping("/ERP2DesignCooperate")
    @XxlJob("ERP2DesignCooperate")
    public ApiResponse ERP2DesignCooperate(Integer date) {
        return ApiResponse.success(pcbaOrderService.selectData(date));
    }

    @GetMapping("/searchOrder")
    @XxlJob("SearchOrder")
    public ApiResponse searchOrder() {
        pcbaOrderService.searchOrder();
        return ApiResponse.success(null);
    }
    /**
     * erp 2 cad 同步到李总cad项目
     * @param date
     * @return
     */
    @GetMapping("/ERP2Cad")
    @XxlJob("ERP2Cad")
    public ApiResponse ERP2Cad(Integer date) {
        return ApiResponse.success(pcbaOrderService.ERP2Cad(date));
    }
}

